package com.distribute.framework.dao;

import java.util.List;
import java.util.Map;

import com.distribute.framework.core.util.Function;
import com.distribute.framework.core.web.util.Page;
import com.distribute.framework.model.TbBalanceStatistics;

/**
 * 余额产品统计的Dao接口
 * @author 刘代应
 */
@SuppressWarnings("unchecked")
public interface ITbBalanceStatisticsDao
{
	/**
	 * 获取所有余额产品统计
	 * @return
	 */
	public List<TbBalanceStatistics> getTbBalanceStatisticsList(Map params,Integer offset,Integer size);

	/**
	 * 获取余额产品统计统计
	 * @return
	 */
	public List getTbBalanceStatisticsStats(Map params,Map<String,Object> groups,Map<String,Object> sums);

	/**
	 * 获取余额产品统计总数
	 * @return
	 */	
	public Long getTbBalanceStatisticsCount(Map params);
	
	/**
	 * 获取余额产品统计自定义求和表达式,比如求和:eval="sum(id)"
	 * @return
	 */	
	public <T> T getTbBalanceStatisticsEval(String eval,Map params);
	
	/**
	 * 获取余额产品统计分页
	 * @return
	 */	
	public Page getTbBalanceStatisticsPage(int page,int size,Map params);
	
	/**
	 * 根据查询条件取余额产品统计
	 * @param params
	 * @return
	 */
	public TbBalanceStatistics getTbBalanceStatistics(Map params);	

	/**
	 * 根据ID取余额产品统计
	 * @param id
	 * @return
	 */
	public TbBalanceStatistics getTbBalanceStatisticsById(Long id);


	
	

	/**
	 * 保存余额产品统计
	 * @param tbBalanceStatistics
	 */
	public TbBalanceStatistics saveTbBalanceStatistics(TbBalanceStatistics tbBalanceStatistics);

	/**
	 * 更新余额产品统计
	 * @param tbBalanceStatistics
	 */
	public int updateTbBalanceStatistics(TbBalanceStatistics tbBalanceStatistics);
	/**
	 * 更新余额产品统计非空字段
	 * @param tbBalanceStatistics
	 */
	public int updateTbBalanceStatistics$NotNull(TbBalanceStatistics tbBalanceStatistics);

	/**
	 * 根据ID删除一个余额产品统计
	 * @param id
	 */
	public void deleteTbBalanceStatisticsById(Long id);
	
	/**
	 * 根据条件更新余额产品统计
	 * @param values
	 * @param params
	 */
	public int updateTbBalanceStatisticsByConfirm(Map values, Map params);
	/**
	 * 根据条件删除余额产品统计
	 * @param params
	 */
	public void deleteTbBalanceStatisticsByConfirm(Map params);
	
	/**
	 * 执行过程，以便事务回滚
	 * @param function
	 */
	public <T> T executeTransaction(Function function);

}